<template>

    <van-swipe :autoplay="3000" lazy-render>
        <van-swipe-item v-for="image in images" :key="image">
            <img :src="image" style="width: 100%; height: 20rem;" />
        </van-swipe-item>
    </van-swipe>

    <div>{{ detailApiData.goods_name }}</div>
    <div v-html="detailApiData.goods_introduce">

    </div>
    <van-action-bar>
        <van-action-bar-icon icon="chat-o" text="客服" dot />
        <van-action-bar-icon icon="cart-o" text="购物车" badge="5" />
        <van-action-bar-icon icon="shop-o" text="店铺" badge="12" />
        <van-action-bar-button type="warning" text="加入购物车" />
        <van-action-bar-button type="danger" text="立即购买" />
    </van-action-bar>
</template>

<script setup>
import { detailApi } from '@/api/app';
import { useRoute } from 'vue-router';
const route = useRoute()
import { ref } from 'vue';
const detailApiData = ref([])
detailApi(route.params.goods_id).then(res => {
    console.log('数据', res);
    detailApiData.value = res.data.message
})

const images = [
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg',
    'https://fastly.jsdelivr.net/npm/@vant/assets/apple-4.jpeg',
];
</script>

<style lang="scss" scoped></style>